package com.liqing.movecomment.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @TableName comment
 */
@TableName("comment")
public class Comment implements Serializable {
    /**
     * 评论id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;
    /**
     * 电影的的 id
     */
    private Integer otherId;
    /**
     * 根id
     */
    private String root;
    /**
     * 被评论的评论的id
     */
    private String parent;
    /**
     * 留言内容
     */
    private String message;
    /**
     * 留言人的id
     */
    private Integer replyId;
    /**
     * 被留言的人的id
     */
    private Integer replyedId;
    /**
     * 当前留言的层级
     */
    private Integer level;
    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    //<editor-fold defaultstate="collapsed" desc="delombok">
    @SuppressWarnings("all")
    public Comment() {
    }

    /**
     * 评论id
     */
    @SuppressWarnings("all")
    public Integer getId() {
        return this.id;
    }

    /**
     * 电影的的 id
     */
    @SuppressWarnings("all")
    public Integer getOtherId() {
        return this.otherId;
    }

    /**
     * 根id
     */
    @SuppressWarnings("all")
    public String getRoot() {
        return this.root;
    }

    /**
     * 被评论的评论的id
     */
    @SuppressWarnings("all")
    public String getParent() {
        return this.parent;
    }

    /**
     * 留言内容
     */
    @SuppressWarnings("all")
    public String getMessage() {
        return this.message;
    }

    /**
     * 留言人的id
     */
    @SuppressWarnings("all")
    public Integer getReplyId() {
        return this.replyId;
    }

    /**
     * 被留言的人的id
     */
    @SuppressWarnings("all")
    public Integer getReplyedId() {
        return this.replyedId;
    }

    /**
     * 当前留言的层级
     */
    @SuppressWarnings("all")
    public Integer getLevel() {
        return this.level;
    }

    /**
     * 创建时间
     */
    @SuppressWarnings("all")
    public LocalDateTime getCreateTime() {
        return this.createTime;
    }

    /**
     * 评论id
     */
    @SuppressWarnings("all")
    public void setId(final Integer id) {
        this.id = id;
    }

    /**
     * 电影的的 id
     */
    @SuppressWarnings("all")
    public void setOtherId(final Integer otherId) {
        this.otherId = otherId;
    }

    /**
     * 根id
     */
    @SuppressWarnings("all")
    public void setRoot(final String root) {
        this.root = root;
    }

    /**
     * 被评论的评论的id
     */
    @SuppressWarnings("all")
    public void setParent(final String parent) {
        this.parent = parent;
    }

    /**
     * 留言内容
     */
    @SuppressWarnings("all")
    public void setMessage(final String message) {
        this.message = message;
    }

    /**
     * 留言人的id
     */
    @SuppressWarnings("all")
    public void setReplyId(final Integer replyId) {
        this.replyId = replyId;
    }

    /**
     * 被留言的人的id
     */
    @SuppressWarnings("all")
    public void setReplyedId(final Integer replyedId) {
        this.replyedId = replyedId;
    }

    /**
     * 当前留言的层级
     */
    @SuppressWarnings("all")
    public void setLevel(final Integer level) {
        this.level = level;
    }

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @SuppressWarnings("all")
    public void setCreateTime(final LocalDateTime createTime) {
        this.createTime = createTime;
    }

    @Override
    @SuppressWarnings("all")
    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof Comment)) return false;
        final Comment other = (Comment) o;
        if (!other.canEqual((Object) this)) return false;
        final Object this$id = this.getId();
        final Object other$id = other.getId();
        if (this$id == null ? other$id != null : !this$id.equals(other$id)) return false;
        final Object this$otherId = this.getOtherId();
        final Object other$otherId = other.getOtherId();
        if (this$otherId == null ? other$otherId != null : !this$otherId.equals(other$otherId)) return false;
        final Object this$replyId = this.getReplyId();
        final Object other$replyId = other.getReplyId();
        if (this$replyId == null ? other$replyId != null : !this$replyId.equals(other$replyId)) return false;
        final Object this$replyedId = this.getReplyedId();
        final Object other$replyedId = other.getReplyedId();
        if (this$replyedId == null ? other$replyedId != null : !this$replyedId.equals(other$replyedId)) return false;
        final Object this$level = this.getLevel();
        final Object other$level = other.getLevel();
        if (this$level == null ? other$level != null : !this$level.equals(other$level)) return false;
        final Object this$root = this.getRoot();
        final Object other$root = other.getRoot();
        if (this$root == null ? other$root != null : !this$root.equals(other$root)) return false;
        final Object this$parent = this.getParent();
        final Object other$parent = other.getParent();
        if (this$parent == null ? other$parent != null : !this$parent.equals(other$parent)) return false;
        final Object this$message = this.getMessage();
        final Object other$message = other.getMessage();
        if (this$message == null ? other$message != null : !this$message.equals(other$message)) return false;
        final Object this$createTime = this.getCreateTime();
        final Object other$createTime = other.getCreateTime();
        if (this$createTime == null ? other$createTime != null : !this$createTime.equals(other$createTime)) return false;
        return true;
    }

    @SuppressWarnings("all")
    protected boolean canEqual(final Object other) {
        return other instanceof Comment;
    }

    @Override
    @SuppressWarnings("all")
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $id = this.getId();
        result = result * PRIME + ($id == null ? 43 : $id.hashCode());
        final Object $otherId = this.getOtherId();
        result = result * PRIME + ($otherId == null ? 43 : $otherId.hashCode());
        final Object $replyId = this.getReplyId();
        result = result * PRIME + ($replyId == null ? 43 : $replyId.hashCode());
        final Object $replyedId = this.getReplyedId();
        result = result * PRIME + ($replyedId == null ? 43 : $replyedId.hashCode());
        final Object $level = this.getLevel();
        result = result * PRIME + ($level == null ? 43 : $level.hashCode());
        final Object $root = this.getRoot();
        result = result * PRIME + ($root == null ? 43 : $root.hashCode());
        final Object $parent = this.getParent();
        result = result * PRIME + ($parent == null ? 43 : $parent.hashCode());
        final Object $message = this.getMessage();
        result = result * PRIME + ($message == null ? 43 : $message.hashCode());
        final Object $createTime = this.getCreateTime();
        result = result * PRIME + ($createTime == null ? 43 : $createTime.hashCode());
        return result;
    }

    @Override
    @SuppressWarnings("all")
    public String toString() {
        return "Comment(id=" + this.getId() + ", otherId=" + this.getOtherId() + ", root=" + this.getRoot() + ", parent=" + this.getParent() + ", message=" + this.getMessage() + ", replyId=" + this.getReplyId() + ", replyedId=" + this.getReplyedId() + ", level=" + this.getLevel() + ", createTime=" + this.getCreateTime() + ")";
    }
    //</editor-fold>
}
